package com.szc.demo01.controller.boss;

import com.szc.demo01.controller.base.BaseController;
import com.szc.demo01.exception.NotBossException;
import com.szc.demo01.pojo.MFile;
import com.szc.demo01.service.FileService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: ShiZhiCheng
 * @Date: 2021/01/16 15:21:48
 */
@Controller
public class BossFormsController extends BaseController {

    @Resource
    FileService fileService;

    /**
     * boss查看所有已发送文件
     */
    @GetMapping("/boss_receive.html")
    public String bossReceive(Model model) throws NotBossException {
        assertUserIdHasPerm(2);
        List<MFile> fileList = fileService.list();
        model.addAttribute("files",fileList);
        return "form/form_send";
    }
}
